#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

int main() {
    int fd;
    fd = open("./1.txt", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
    char buff[512] = "hello";
    write(fd, buff, sizeof(buff));
    char readBuff[512] = {0};
    close(fd);
    fd = open("./1.txt", O_RDWR);
    read(fd, readBuff, sizeof(readBuff));
    printf("%s\n", readBuff);

    return 0;
}